<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		 <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
         <link rel="stylesheet" href="../assets/css/layui.css?t=1542630986934"">
         <link rel="stylesheet" href="../assets/css/view.css"/>
         <link rel="icon" href="/favicon.ico">
         <link rel="stylesheet" type="text/css" href="../assets/css/layui.css"/>
         <script src="../assets/layui.all.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
		<link rel="stylesheet" type="text/css" href="../js/bootstarp-3.3.7/css/bootstrap.min.css" />
		    <script src="../vendor/jquery/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
		    <script src="../js/jquery-3.2.0.min.js" type="text/javascript" charset="utf-8"></script>
		    <link rel="stylesheet" type="text/css" href="../js/bootstarp-table-1.11.1/bootstrap-table.min.css" />
		    <script src="../js/bootstarp-3.3.7/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
		    <script src="../js/bootstarp-table-1.11.1/bootstrap-table.min.js" type="text/javascript" charset="utf-8"></script>
		    <script src="../js/bootstarp-table-1.11.1/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf-8"></script>
     <script>
			$(function() { //, headers: { 'x-requested-with': 'XMLHttpRequest' }
				$.ajaxSetup({
					crossDomain: true,
					xhrFields: {
						withCredentials: true
					}
				});
			});
		</script>
         
     	  <script type="text/javascript">
     		$(function(){
     			$("#table").bootstrapTable({
     				type:"post",
					url: "http://127.0.0.1:8099/pckc/getAllPur",
					pagination:true,
					pageSize:5, 
					queryParams:queryParam,
					columns: [{
						field: 'purchase_id',
						title: '序号',
						align: 'center',

					},{
						field: 'batches_of_inventory_number',
						title: '采购单编号',
						align: 'center',

					},{
						field: 'medicines_name',
						title: '药品名称',
						align: 'center',

					},{
						field: 'medicines_class',
						title: '药品分类',
						align: 'center',
						
					},{
						field: 'producter',
						title: '生产厂家',
						align: 'center',
 
					},{
						field: 'conversion',
						title: '规格',
						align: 'center',

					},{
						field: 'purchase_num',
						title: '库存',
						align: 'center',
						 
					},{
						field: 'purchase_trade_price',
						title: '批发价',
						align: 'center',

					},{
						field: 'purchase_prescription_price',
						title: '处方价',
						align: 'center',

					},{ 
						field: 'purchase_trade_total_amount',
						title: '批发额',
						align: 'center',

					},{
						field: 'purchase_prescription_total_amount',
						title: '处方额',
						align: 'center',

					}
					]
					
     			})
     			
     			$('#btn2').on('click',function(){
                    window.location.href="stock1.html";
              }) 
                $('#btn').on('click',function(){
                    window.location.href="stock.html";
               })
     	}) 
     		function queryParam() {  
             
               return{
               	 'medicines_name':$("#medicines_name").val(),
               }
     		}	
     		
      		function sel () {    			
     			$("table").bootstrapTable('refresh');
     			
     		}
      		
           
            
            
          
      		
      		
      		
      		 
     		
          </script>
	</head>
	<body class="layui-view-body">
		<div class="layui-content">
           
        <div class="layui-row">

  	<table align="center">
  		<tr>
  			<td><button type="button" class="layui-btn layui-btn-blue"  id="btn" style=" width: 250px; display:block;margin:0 auto">药品总库存</button></td>
  			<td><button type="button" class="layui-btn layui-btn-blue"  id="btn2" style=" width: 250px; display:block;margin:0 auto">批次库存及价格</button></td>
  		</tr>
  	</table>
        	
        <div class="layui-card">
                <div class="layui-card-body">			 
                    <div class="form-box">
                        <div class="layui-form layui-form-item">
                            <div class="layui-inline">
                            
                                <div class="layui-form-mid">药品名称:</div>
                                <div class="layui-input-inline" style="width: 100px;">
                                  <input type="text" id="medicines_name"  autocomplete="off" class="layui-input" oninput="sel()" >
                                </div>                              

                            </div>
                        </div>                      
                    </div> 
                </div>
                
                
                
                
                
            </div>
        </div>
    </div>
		
		

		  <table id="table" border="1px"></table>
     <script src="../assets/layui.all.js"></script> 
     <script>
      var element = layui.element;
      var table = layui.table;
      var form = layui.form;
   

    </script>
	</body>
</html>
